/**
 * @author Wang Chen Peng
 * @date 2019/01/09
 * describe: 回文数
 * https://leetcode-cn.com/problems/palindrome-number/
 */
public class palindromeNumber {

    public static void main(String[] args) {
        if (test1(234565432)){
            System.out.println("是");
        }else {
            System.out.println("不是");
        }
    }

    public static boolean test1(int x) {
        String str = String.valueOf(x);
        int length = str.length();
        int max = length/2;
        boolean flag = true;
        for (int index=0;index<max;index++){
            if (str.charAt(index)!=str.charAt(length-1-index)){
                return false;
            }
        }
        return flag;
    }

}
